<script>
	export default {
		onLaunch: function(item) {
			console.log(item)
			let token = uni.getStorageSync('token')
			if(item.query && item.query.hasOwnProperty('scene')){
				console.log(item.query.scene)
				uni.setStorage({
					data:item.query.scene,
					key:'invitecode',
					success:()=> {
						console.log('success')
						if (token) {
							this.$getLogin()
						}
					}
				})
			} else {
				if (token) {
					this.$getLogin()
				}
			}
		},
		onShow: function() {
			// 获取地址数据
			this.$store.dispatch('getAddress')
			// 获取学院
			this.$store.dispatch('getCollege')
			// 获取年级
			this.$store.dispatch('getGrade')
			// 获取专业
			this.$store.dispatch('getSpeciality')
			// 卖书须知、流程、地址
			this.$store.dispatch('getSelling')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<!-- 每个页面公共css -->
<style src='./static/style/rest.css'></style>
<style lang="scss">
	@import "uview-ui/index.scss";
</style>